//
//  PKPlayListTableViewCell.m
//  AMomentApp
//
//  Created by lanou on 15/10/6.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKPlayListTableViewCell.h"
#import "UIButton+WebCache.h"
@implementation PKPlayListTableViewCell

-(void)setConfigureModel:(PKRadioDetailModel *)configureModel
{
    _configureModel = configureModel;
    self.titleLabel.text = configureModel.title;
    self.userNameLabel.text = [NSString stringWithFormat:@"by: %@",configureModel.playInfo.userinfo.uname];
    if (configureModel.isSelected) {
        _leftView.backgroundColor = [UIColor greenColor];
    }else
    {
        _leftView.backgroundColor = [UIColor whiteColor];
    }
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 5, 60)];
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 5, 200, 20)];
        _userNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 30, 200, 20)];
        _userNameLabel.font = [UIFont systemFontOfSize:14];
        _downloadButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _downloadButton.frame = CGRectMake(SCREEN_WIDTH-30, 20, 20, 20);
        [_downloadButton setImage:[UIImage imageNamed:@"download"] forState:UIControlStateNormal];
        [self.contentView addSubview:_leftView];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_userNameLabel];
        [self.contentView addSubview:_downloadButton];
    }
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
